import {reqcatelist} from '../../http/api'
let state = {
    arr:[]
};
let getters = {
    arr(state){
        return state.arr
    }
}
let mutations = {
    changeArr(state,arr){
        state.arr = arr
    }
};
let actions = {
    reqArr(context){
        return new Promise((resolve,reject) => {
            reqcatelist({istree:true}).then(res => {
                let arr = res.data.list ? res.data.list : [];
            context.commit('changeArr',arr);
            resolve()
            })
            
        })
    }
}
export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}